/**
 * @description  : 证照-页签组件
 * @descriptionDetail : 证照-页签组件
 * @copyright    : 浙江烟草
 * @author       : dw
 * @create       : 2022-12-05 10:36:34
 */
<template>
  <view>
    <view class="retail">
      <fsection :title="title.basemsg" class="pl-16"></fsection>
      <u-gap :height="$theme.cm_section_top_gap_height" :bg-color="$theme.cm_gap_color"></u-gap>
    </view>
    <view class="rdcontent">
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            许可证件
          </view>
          <view class="msg-context">
            {{ basemsg.licNo || "/" }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            老许可证件
          </view>
          <view class="msg-context">
            {{ basemsg.oldLicNo || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" justify="space-between" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            企业名称（字号）
          </view>
          <view class="msg-context">
            {{ basemsg.companyName || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" justify="space-between" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            经营地址
          </view>
          <view class="msg-context">
            {{ basemsg.businessAddr || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" justify="space-between" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            统一社会信用代码
          </view>
          <view class="msg-context">
            {{ basemsg.businessLicNo || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            许可有效期
          </view>
          <view class="msg-context">
            {{ basemsg.validateStart || "/" }}至 {{ basemsg.validateEnd || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            许可证状态
          </view>
          <view class="msg-context">
            {{ basemsg.licStatusName || "/" }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            系统编码
          </view>
          <view class="msg-context">
            {{ retailId || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            许可范围
          </view>
          <view class="msg-context">
            {{ basemsg.managerScopeName|| "/" }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            管辖组织机构
          </view>
          <view class="msg-context">
            {{ basemsg.issueOrgName || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            制证日期
          </view>
          <view class="msg-context">
            {{ basemsg.issueDate || "/" }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            初制证日期
          </view>
          <view class="msg-context">
            {{ basemsg.firstAccrediDate || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            持证人
          </view>
          <view class="msg-context">
            {{ basemsg.managerName || "/" }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            企业类型
          </view>
          <view class="msg-context">
            {{ basemsg.ecoTypeName || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            供货单位
          </view>
          <view class="msg-context">
            {{ basemsg.supplyCompanyName || "/" }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            供货状态
          </view>
          <view class="msg-context">
            {{ basemsg.supplyStatusName || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            群体类型
          </view>
          <view class="msg-context">
            {{ specialTypeName }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            其他群体类型
          </view>
          <view class="msg-context">
            {{ basemsg.specialTypeOther || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            享受合理布局照顾政策
          </view>
          <view class="msg-context">
            {{ basemsg.layoutPolicyTypeName || "/" }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            零售业态
          </view>
          <view class="msg-context">
            {{ basemsg.bizFormatName || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            二维码制卡
          </view>
          <view class="msg-context">
            {{ $u.dic.getDicNameByKeyCode($u.dic.DIC_KEYS.L_QR_CARD_STATUS,basemsg.isQrCard) || '/' }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            NFC卡号
          </view>
          <view class="msg-context">
            {{ basemsg.nfcNo || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            营业执照登记状态
          </view>
          <view class="msg-context">
            {{ basemsg.registeredStatusName || "/" }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            失效日期
          </view>
          <view class="msg-context">
            {{ basemsg.invalidTime || "/" }}
          </view>
        </u-col>
      </u-row>
      <u-row gutter="16" align="top" class="divided-line">
        <u-col span="6">
          <view class="msg-title">
            营业执照有效期类型
          </view>
          <view class="msg-context">
            {{ $u.dic.getDicNameByKeyCode($u.dic.DIC_KEYS.L_BUSINESS_VALID_TYPE,basemsg.businessValidType) || '/' }}
          </view>
        </u-col>
        <u-col span="6">
          <view class="msg-title">
            营业执照有效期起止
          </view>
          <view class="msg-context">
            {{ basemsg.businessValidStart || "/" }} 至 {{ basemsg.businessValidEnd || "/" }}
          </view>
        </u-col>
      </u-row>
    </view>
  </view>
</template>

<script>
import fsection from "@/components/form-section.vue";
export default {
  components:{
    fsection,
  },
  props:{
    licenceInfo:{
      type:Function,
      default:() => {},
    },
  },
  data(){
    return{
      title:{
        basemsg:"证件信息",
      },
      basemsg:{},
      specialTypeName:"",
      retailId:"",
    }
  },
  created(){
  },
  mounted(){
    this.licenceInfo().then(res => {
      if(res.success){
        this.basemsg = res.bean.licenseInfoPre;
        this.retailId = this.basemsg.retailerUuid.substring(23,32)
        this.getSpecialType();
      }
    });
  },
  methods:{
    getSpecialType () {
      if (this.basemsg.specialType) {
        let tmp = [];
        this.specialType = this.basemsg.specialType.split(',');
        this.specialType.map((item) => {
          tmp.push(this.$u.dic.getDicNameByKeyCode(this.$u.dic.DIC_KEYS.SPECIAL,item));
        });
        if (tmp.length > 0) {
          this.specialTypeName = tmp.join(',');
        }
      } else {
        this.specialTypeName = '/';
      }
    },
  },

}
</script>

<style lang="scss" scoped>
@import "./retailItem.scss";
</style>
